#define TOP    0
#define BOTTOM 1
#define SLIDER_WIDTH 16
#define SECS_PER_MIN 60

#define MAX_PLAYERS   8
#define MAX_NAME_LEN 10

void Pause(int frames);
void DisplayBet(int player, int bet);
void DisplayOdds(int player, double percent);
void DisplayPlayer(int player, bool inverse);
void DisplayCards(int player, bool show = true);
void DisplayPot(void);
void DisplayBetOptions(int player, int MinBet, int lastRaise, int CurrentBet, bool override = false);
void prints(int screen, int x, int y, const char *fmt, ...);
void DisplayCurrentBet(int bet, int player);
void DrawTable(void);
void DisplayHoleCards(int player);
void RevealHoleCards(int player, bool clear = false);
void InitScreen(void);
void DisplayMessage(const char *fmt, ...);
void ClearMessage(void);
void ClearRows(int screen, int y1, int y2);
void WaitForTouch(void);
int TimeInSeconds(void);
int TimeLeft(void);
void Pause(int seconds);
int GetMenuOption(int numOptions, int defaultOption, ...);
void Cls(int screen);
void DisplayKeys(int x, int y, const char *row);
void GetPlayerName(char *name);
void HorizLine(int screen, int x, int y, int width, bool bottom);
void VertLine(int screen, int x, int y, int height, bool left);
void UpdateScreens();
void DisplayCommunityCards(int numCards, int screen);
void SetAllIn(void);
void HighlightAllPlayers(bool highlight);
void DisplayAction(int player, bool show);
bool CanHunt(int player);
void TakeSeat(void);
void DisplayCheckBox(int screen, int x, int y, bool checked);
void ShowReplay(bool show); 
void SwitchSitOut(void);
void Beep(void);
int KeyPressed(touchPosition *touch = NULL);
void PreparePlayer(int player);
void SetupMonteCarlo(int);

// Used for calculating/displaying all-in odds.
void KillCard(int rank, int suit);
void InitializeForOdds(void);
void SetHoleCards(int rank, int suit, int rank2, int suit2);
void SetBoardCard(int rank, int suit);
void CalculateHandOdds(void);

#define YELLOW  RGB15(31, 31, 8)
#define BLUE    RGB15(0, 0, 31)

enum GameMode
{
    gm_Standalone = 0,
    gm_Networked,
    gm_Load,
    gm_SetName,
    gm_Menu = 1000
};

enum GameType
{
    gt_Holdem = 0,
    gt_Omaha
};

enum GameState {
    gs_Setup = 0,
    gs_NewHand,
    gs_PreFlopBetting,
    gs_RunFlop,
    gs_PostFlopBetting,
    gs_RunTurn,
    gs_PostTurnBetting,
    gs_RunRiver,
    gs_PostRiverBetting,
    gs_Showdown,
    gs_Rebuy,
    gs_WaitingForRebuy,
    gs_Complete
};

enum Button {
    btn_None,
    btn_Any,
    btn_Replay,
    btn_Quit,
    btn_Fold,
    btn_HoleCards,
    btn_CheckCall,
    btn_BetRaise,
    btn_AllIn,
    btn_23Pot,
    btn_34Pot,
    btn_Pot,
    btn_Confirm,
    btn_NumPad,
    btn_Rabbit,
    btn_Minus,
    btn_Plus,
    btn_SitOut,
    btn_Select,
    btn_LeftShoulder,
    btn_RightShoulder
};

struct PLAYER
{
    char   Name[MAX_NAME_LEN];
    int    Cards[4];
    int    DSCRC;
    int16  Bet;
    int16  TotalBet;
    int16  Chips;
    int8   TimeBank;
    int8   RabbitHunts;
    char   Action;
    int8   SitOutHands;
    bool   Folded    : 1;
    bool   SittingIn : 1;
    bool   BigBlind  : 1;
    bool   CanCheck  : 1;
};

struct GAME
{
    int    StartingChips;
    int    SeqNumber;
    int    Board[5];
    int    LevelStartTime;
    int    CurrentTime;
    int16  Blind;
    int16  MinBet;
    int16  Pot;
    int16  LastRaise;
    int8   ActionOnPlayer;
    int8   ButtonPos;
    int8   LastToAct;
    int8   Raiser;
    int8   TotPlayers;
	int8   MaxPlayers;
	int8   CardsShowing;
    GameType Type     : 4;
    bool   AllIn      : 1;
    bool   Showdown   : 1;
    bool   RabbitHunt : 1;
    GameState    State;
    PLAYER Players[MAX_PLAYERS];
};
